using UnityEngine;

public class PresentTween : MonoBehaviour
{
	private Transform myTransform;

	public float minSize = 1f;

	public float maxSize = 1.25f;

	public float tweenCycleTime = 1f;

	private float timeBetweenCycles;

	private float timer;

	private void Awake()
	{
		myTransform = base.transform;
	}

	private void OnEnable()
	{
		timer = 0f;
		timeBetweenCycles = Random.Range(0.5f, 3f);
	}

	private void Update()
	{
		timer += Time.deltaTime;
		if (timer >= timeBetweenCycles + tweenCycleTime)
		{
			timeBetweenCycles = Random.Range(0.5f, 3f);
			timer = 0f;
		}
		else if (!(timer > tweenCycleTime))
		{
			float num = MathEx.PingPong(timer / tweenCycleTime);
			if (num < 0f)
			{
				num += 1f;
			}
			num = minSize + (maxSize - minSize) * num;
			myTransform.localScale = new Vector3(num, num, num);
		}
	}
}
